---
title: Execute the Appworx submission stored procedure
summary: Instance method that builds and executes the BOF portal request calling submit_appworx_job.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-08-21
library: SAIF.Services.Appworx
reference_type: embedded
operation_id: OP-02
trigger: Called by the shared overload, or directly by any caller that constructed the class and set its properties
---

# Execute the Appworx submission stored procedure

This is the instance method that actually calls the Oracle stored procedure `submit_appworx_job` through the BOF data portal, using the instance's current `ModuleName`, `Requestor`, `Printer`, and populated argument slots.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-02 |
| **Trigger** | Called by [Submit an Appworx batch job (shared overload)](submit-batch-job-shared.md), or directly by any caller that constructed the class and set its properties |
| **Inputs** | Instance state — `DPI`, `ModuleName`, `Requestor`, `Printer`, `Arg1`..`Arg20` |
| **Outputs** | None. `vResult` is declared and initialized to `String.Empty` but never assigned or read (dead local)* |
| **Primary components** | `clsRequestAppworxJob.SubmitBatchJob` (instance) |
| **Entry point** | `SAIF.Services.Appworx/clsRequestAppworxJob.vb` |

## Steps

1. `PortalRequest = DPI.NewPortalRequest`; `DataRequest = PortalRequest.NewRequest` — obtain a BOF portal request and a single data request from it.
2. Set request metadata: `DataRequest.ID = "clsRequestJob.SubmitBatchJob"` (note: names `clsRequestJob`, not the actual class `clsRequestAppworxJob` — a stale identifier*), `RequestType = DataRequestType.NonQuery`, `CommandType = CommandType.StoredProcedure`, `SQLStatement = "submit_appworx_job"`.
3. Add the three fixed parameters unconditionally: `inModule` ← `ModuleName` (size 30), `inRequestor` ← `Requestor` (size 32), `inPrinter` ← `Printer` (size 30) ([BR-004](../business-rules.md#br-004-module%2C-requestor%2C-and-printer-are-always-supplied-with-defaults), [BR-005](../business-rules.md#br-005-submission-values-are-length-bounded-to-the-schedulers-contract), [SQL-001](../sql/SQL-001-submit-appworx-job.md)).
4. For each slot 1–20, test `Not m_ArgN.IsEmpty`; when non-empty, add parameter `inArgN` ← `ArgN` with size 4000 ([BR-003](../business-rules.md#br-003-only-populated-argument-slots-are-transmitted), [BR-005](../business-rules.md#br-005-submission-values-are-length-bounded-to-the-schedulers-contract), [SQL-001](../sql/SQL-001-submit-appworx-job.md)). Empty slots are omitted from the parameter list entirely.
5. Execute `DPI.ProcessPortalRequest(PortalRequest)` inside a `Try` ([SQL-001](../sql/SQL-001-submit-appworx-job.md), [JOB_QUEUE](../database-tables.md#job_queue)).
   - > **Origin**: The procedure body executed here is `submit_appworx_job` — see [Stored procedure operations](../procedures/submit-appworx-job.md#operations) for the queue-insert logic performed inside the database.
6. On exception, throw `New ApplicationException("Error Submiting Appworx Job " & ex.Message, ex)` — original exception preserved as inner exception ([BR-006](../business-rules.md#br-006-submission-failures-are-wrapped-and-rethrown)). (The message contains the spelling "Submiting".)
7. Set `PortalRequest` and `DataRequest` to `Nothing` — legacy cleanup with no effect in .NET*.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start(["Instance SubmitBatchJob<br>called"]) --> S1["Obtain PortalRequest and<br>DataRequest"]
	S1 --> S2[Set request metadata:<br>submit_appworx_job, NonQuery, StoredProcedure]
	S2 --> S3[Add fixed params:<br>inModule, inRequestor, inPrinter]
	S3 --> S4{For each Arg1..Arg20:<br>non-empty?}
	S4 -->|Yes| S5[Add inArgN parameter]
	S4 -->|No| S6[Skip parameter]
	S5 --> S7[Execute ProcessPortalRequest]
	S6 --> S7
	S7 -->|success| EndOk([Returns])
	S7 -->|exception| EndErr(["Throw wrapped<br>ApplicationException"])
```

## Failure and edge-case behavior
- The only branches are the 20 empty-slot tests; the only error path is the wrap-and-rethrow ([BR-006](../business-rules.md#br-006-submission-failures-are-wrapped-and-rethrown)).
- No result is inspected, so a procedure that silently does nothing (see PR-006 in [Stored procedure operations](../procedures/submit-appworx-job.md#operations)) is indistinguishable from success from this library's perspective ([BR-008](../business-rules.md#br-008-submission-is-fire-and-forget)).

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `SAIF.Services.Appworx/clsRequestAppworxJob.vb`
